<!DOCTYPE html>
  <html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
      <title>title</title>
      <link rel="stylesheet" type="text/css" href="../css/api.css"/>
      <style>

      .header{
            width: 93%;
            height: 2.5rem;
            line-height: 2.5rem;
            padding: 0.5rem 0.8rem;
            text-align: center;
            position: fixed;
            top:1.5rem;
            background-color: #fff;
            z-index: 999;
        }
      .header_img{
        width: 6%;
        height: 45%;
        float: left;
        margin-top: 0.5rem;
      }
      .header_img img{
        width: 100%;
        height: 100%;
      }
      .header h3{
        line-height: 3rem;
        width: 90%;
        margin-left: 0.7rem;
        text-align: center;
      }

          .ul_log {
              width: 100%;
              height: 2.5rem;
              margin-top: 3rem;
          }

          .ul_log ul {
              width: 70%;
              margin: 0 auto;
              padding: 0.5rem 0.8rem;
          }

          .ul_log ul li {
              width: 45%;
              height: 2.5rem;
              line-height: 2.5rem;
              list-style: none;
              text-decoration: none;
              display: block;
              float: left;
              text-align: center;
              font-size: 1.2rem;
              font-weight: bold;
          }

          #li {
              color: #40cccc;
          }

          .lines_s {
              position: absolute;
              top: 7.8rem;
              right: 34%;
              border-bottom: 0.25rem solid #40cccc;
              width: 1.5rem;
          }
        .nav{
          width: 93%;
          height: 1.5rem;
          line-height: 1.5rem;
          padding: 0.5rem 0.8rem;
          position: fixed;

          /*margin-top: 0.8rem;*/
        }
        /*.nav ul{
          width: 100%;
          height: 1.5rem;
        }*/
        .nav ul li{
          width: 16%;
          height: 1.8rem;
          line-height: 1.8rem;
          border-right: 0.1rem solid rgb(223,223,223,0.3);
          text-align: center;
          float: left;
        }
        .nav ul li a{
          list-style: none;
          text-decoration: none;
          font-size: 1rem;
          color: #ccc;
        }
        .math{
          width: 90%;
          height: 100%;
          /*position: fixed;*/
          margin-top: 3rem;
          background-color: rgb(242, 242, 242, 0.5);
          padding: 2rem 1rem;
          overflow: scroll;
        }
        .math::-webkit-scrollbar {
       display: none;/*隐藏滚动条*/
   }
        .math_one{
          width: 100%;
          height:12rem;
          background-color: #fff;
          margin-top: 0.8rem;
          border-radius: 0.5rem;
        }
        .one_img{
          width: 35%;
          height: 9.5rem;

          float: left;
          margin-top: 0.5rem;
          margin-left: 0.2rem;
        }
        .one_img img{
          width: 100%;
          height: 100%;
            border-radius: 0.8rem;
        }
        .one_text{
          width: 59%;
          padding:0.5rem 0rem 0.5rem 1rem;
          float: left;
        }
        .tp{
          width: 60%;
          height: 1.5rem;
          border: 1px solid #40cccc;
          color: #40cccc;
          margin-top: 0.3rem;
          line-height: 1.5rem;
          border-radius: 0.5rem;
          text-align: center;
          font-size: 0.9rem;
        }
        .ttp{
          width: 100%;
          height: 1.5rem;
          margin-top: 0.5rem;
          line-height: 1rem;
          font-size: 0.8rem;
          color: #ccc;
        }
        .one_w{
          width:100%;
          height: 1.5rem;
          margin-top:0.5rem;

        }

        #nav_list{
          background-color: white;
          overflow-x: scroll; /*添加横向滚动条*/
          white-space: nowrap;
          width: 100%;
          height: 1.5rem;

        }
      </style>
  </head>
  <body>

  <!-- 分类 -->
  <div class="header">
    <div class="header_img">
      <img src="../image/u18.png" alt="" onclick="closewin()">
    </div>
    <h3>我的作业</h3>
  </div>
  <!-- 内容 -->
  <div class="math" id="cur_list">
    <!-- <div class="math_one">
      <div class="one_img">
        <img src="../image/u64.png" alt="">
      </div>
      <div class="one_text">
        <h4>青少年英语课程</h4>
        <p class="tp">3-6岁幼儿英语</p>
        <p class="ttp">多元教学法趣味学英语，听讲读写能力综合培养</p>
        <div class="one_w">
          <div class="w_img">
            <img src="../image/aa1.png" alt="">
          </div>
          <p style="font-size:0.9rem">15.0km长春·美景天城</p>
        </div>
        <span style="font-size:1.5rem;color:red;float:left;margin-left:70%;margin-top:-0.2rem;">￥78</span>
      </div>
    </div> -->

  </div>
  </body>
  <script type="text/javascript" src="../script/api.js"></script>
  <script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/jquery-1.8.3.js"></script>
<script type="text/javascript">
  var page = 1;
  var pagesize = 20;
  var cur_id = 0
  var userinfo=$api.getStorage('userinfo')
  var ok = true
  var search_value
  apiready = function(){
    search_value = api.pageParam.search_value
    //  get_nav()//获取导航的分类
      get_list()
      api.addEventListener({
        name : 'scrolltobottom',
          extra : {
            threshold : 0 //设置距离底部多少距离时触发，默认值为0，数字类型
          }
        }, function(ret, err) {
          get_list()
        });
        api.addEventListener({
            name:'add_pls',
            extra:{
                threshold:0
            }
        }, function(ret, err){
              $("#cur_list").html('')
              ok = true
                page = 1
                get_list()
                //get_user()//获取用户数据

        });
  };
  function opens(id) {
    api.openWin({
        name: 'lookcur',
        url: './lookcur.html',
        pageParam: {
                    id: id
                }
    });
  }
  function xx_s(id) {
    api.openWin({
        name: 'zy_list',
        url: './zy_list.html',
        pageParam: {
                    id: id,

                }
    });
  }
  function video_s(id) {

    api.openWin({
        name: 'videos',
        url: './videos.html',
        pageParam: {
                    id: id
                }
    });
  }

function get_list() {
  if(ok==false){
    return false
  }
api.showProgress({
    style: 'default',
    animationType: 'fade',
    title: '努力加载中...',
    text: '先喝杯茶...',
    modal: false
});

  api.parseTapmode
  var html =''
  var obj = $api.byId('cur_list');
  api.ajax({
      url: SITE_URL+'cur_api/cur/mycur',
      method: 'post',
      data: {
          values: {
              page:page,
              pagesize:pagesize,
              user_id:userinfo.id
          }
      }
  },function(ret, err){
      if (ret) {
        if(ret.error==200){
          if(ret.data.length){
            for (var i = 0; i < ret.data.length; i++) {
              var dat = ret.data[i]
              //alert(ret.data.type)

                html +='<div class="math_one" onclick="xx_s('+dat.id+')">'


              html +='<div class="one_img">'
              html +='<img src="'+dat.img_url+'" alt="">'
              html +='</div>'
              html +='<div class="one_text">'
              html +='<h4>'+dat.cur_name+'</h4>'
              html +='<p class="tp">'+dat.stage_name+'</p>'
              html +='<p class="ttp">'+dat.cur_title+'</p>'
              html +='<div class="one_w">'
              html +='<div class="w_img">'
              // html +='<img src="../image/aa1.png" alt="">'
              html +='</div>'
              html +='<p style="font-size:0.9rem">'+dat.address+'</p>'
              html +='</div>'
              

              html +='</div>'
              html +='</div>'
            }
            $api.append(obj, html);
            page+=1
          }
        }else{
          msgcode('没有更多了')
          ok = false
        }
        api.hideProgress();
          //alert( JSON.stringify( ret ) );
      } else {
        api.hideProgress();
        msgcode('请检查网络连接')
          //alert( JSON.stringify( err ) );
      }
  });
}

function pl(id) {
  api.openWin({
      name: 'pls',
      url: './pls.html',
      pageParam: {
                  id: id,

              }
  });
}


</script>
</html>
